﻿using Microsoft.Owin.Hosting;
using System;
using System.ServiceProcess;

namespace Sustainalytics.Companies.Service
{
    public partial class CompaniesService : ServiceBase
    {
        public CompaniesService()
        {
            InitializeComponent();
        }

        protected override void OnStart(string[] args)
        {
            try
            {
                var url = HostConfig.GetHostUrl();
                WebApp.Start<Startup>(url);
            }
            catch (Exception ex)
            {
                EventLog.Log = ex.Message;
            }
        }

        protected override void OnStop()
        {
        }
    }
}
